package com.miki.road.sevice.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.miki.road.entity.Device;
import com.miki.road.mapper.DeviceMapper;
import com.miki.road.sevice.IDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * author: Leeon
 * 2020/3/31
 * road
 */
@Service("deviceService")
public class DeviceService implements IDeviceService {

    @Autowired
    private DeviceMapper deviceMapper;

    @Override
    public List<Device> getAll() {
        return deviceMapper.getAll();
    }

    @Override
    public PageInfo<Device> page(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Device> list = deviceMapper.getDevices();
        return PageInfo.of(list);
    }
}
